﻿using Entity;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vote.Models;

namespace Dal
{
   interface IRedisCommon
    {
       /// <summary>
       /// Reids新增集合
       /// </summary>
       /// <typeparam name="T"></typeparam>
       /// <param name="obj"></param>
       /// <param name="sql"></param>
       /// <param name="tableName"></param>
       void InsertListToRedis<T>(string sql, string tableName) where T : class;

       /// <summary>
       /// 通过Redis查询集合
       /// </summary>
       /// <typeparam name="T"></typeparam>
       /// <returns></returns>
       List<T> GetListByRedis<T>() where T : class;

       /// <summary>
       /// 通过场次id获取VoteShowModel的分页
       /// </summary>
       /// <typeparam name="T"></typeparam>
       /// <param name="pageModel"></param>
       /// <param name="VoteNumberId"></param>
       void GetPageListByRedisConditions<T>(ref PageModel<VoteShowModel> pageModel, int VoteNumberId);

      /// <summary>
       /// 通过Redis查询分页集合
      /// </summary>
      /// <typeparam name="T"></typeparam>
      /// <param name="pageIndex"></param>
      /// <param name="pageSize"></param>
      /// <returns></returns>
       void GetPageListByRedis<T>(ref PageModel<T> pageModel) where T : class;

       /// <summary>
       /// 获取单个值
       /// </summary>
       /// <typeparam name="T"></typeparam>
       /// <param name="name"></param>
       /// <returns></returns>
       T GetSimpleByRedis<T>(string name) where T : class;

       /// <summary>
       /// 获取没有过期的场次信息
       /// </summary>
       /// <returns></returns>
       List<VoteNumber> GetVoteNumberByRedis();
    }
}
